package org.home.and.feign;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

/**
 * @author liou
 */
@RestController
public class SystemClient implements ISystemClient{

    @Value("${user.name}")
    private String userName;

    @Override
    @GetMapping(GET_BY_ID)
    public String getById(String code) throws Exception {
        if (Objects.equals("1", code)) {
            throw new Exception();
        }
        return "code：" + code + "--userName：" + userName;
    }
}
